import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 地址信息
 */
@Entity('address_info')
export class AddressInfoEntity extends BaseEntity {

  @Column({ comment: '联系电话', length: 20, nullable: true })
  phone: string;

  @Column({ comment: '省', nullable: true })
  province: string;

  @Column({ comment: '市', nullable: true })
  city: string;

  @Column({ comment: '区', nullable: true })
  district: string;

  @Column({ comment: '详细地址' })
  detailAddress: string;

  @Column({ comment: '是否默认地址', dict: ['否', '是'], default: 0, nullable: true })
  isDefault: number;

  @Index()
  @Column({ comment: '用户ID' })
  userId: number;
}
